/**
 * 
 */
package com.uit.project.bustrip.dao;

import org.json.JSONException;
import org.json.JSONObject;
import android.util.Log;
import com.uit.project.bustrip.daointerface.SeatDao;
import com.uit.project.bustrip.database.DBHelper;
import com.uit.project.bustrip.entity.Seat;
/**
 * @author 
 *
 */
public class SeatDaoImpl extends BaseDaoImpl<Seat, Integer> implements SeatDao {

	public SeatDaoImpl(){
		super();
	}
	public SeatDaoImpl(DBHelper db) {
		super(db);
	}
	@Override
	public Seat getFromJSON(JSONObject json) {
		try {
			Seat item = new Seat();
			item.id = json.getInt("id");
			item.position = json.getInt("position");
			item.trip = json.getInt("trip");
			item.status = json.getInt("status");
			return item;
		} catch (JSONException e) {
			Log.i("UserDaoImpl",e.getMessage());
			return null;
		}
	}
}
